﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace vppServer
{
    /// <summary>
    /// This is an bastract class that all Servers will be drived from to implement the servers that will listen to incoming requests
    /// </summary>
    public abstract class vppserver
    {
        /// <summary>
        /// Triggerd when a Message Is recived
        /// </summary>
        public event EventHandler<MessageRecivedEventArgs> OnMessgaRecived;
        /// <summary>
        /// Open the channel for comunication
        /// </summary>
        public abstract void OpenChannel();
        /// <summary>
        /// Close the channel for comunication
        /// </summary>
        public abstract void CloseChannel();
        /// <summary>
        /// Send A request Code
        /// </summary>
        /// <param name="Code"></param>
        public abstract void SendCode(string Code);
        /// <summary>
        /// Start the code Listner
        /// </summary>
        public abstract void StartListning();
        /// <summary>
        /// Initalise
        /// </summary>
        public abstract void Initalise();
        /// <summary>
        /// Deinitalise
        /// </summary>
        public abstract void Deinitalise();


        public void DoMessage(string msg)
        {
            this.OnMessgaRecived(this, new MessageRecivedEventArgs(msg));
        }
    }
}
